Medication assisted treatment (MAT) is a cornerstone of an effective national response to the epidemic of opioid use disorder (OUD), but lack of access to behavioral interventions and poor adherence to MAT are key barriers to implementation. We propose to test the delivery of a comprehensive cognitive behavioral therapy (CBT), reSET, to determine whether it can improve treatment adherence and thus long term outcome among patients with OUD initiating MAT within a community-based Hub and Spoke? Model of buprenorphine maintenance in central Pennsylvania, developed by the Penn State Milton S Hershey Medical Center with STR funding from the State. reSET (Pear Therapeutics, Inc), is a commercially available version of the web-based Therapeutic Education System (TES), delivered as a mobile app and recently approved by the FDA as the first digital therapeutic adjunct for the treatment of substance use disorders. reSET is based on the Community Reinforcement Approach combined with Contingency Management, translated into computer-interactive learning. Through a series of interactive therapy lessons, the program teaches patients cognitive-behavioral coping skills to resist drug use and to address factors such as craving, depression and other mood problems, and relationship issues that are associated with risk of relapse. The CM component provides concrete rewards contingent on performance of key target behaviors of treatment adherence, including completing the therapy lessons and attending clinic appointments. Prior clinical trials show that the beta version of reSET, TES, improved substance use outcome and/or treatment retention among methadone maintained patients, buprenorphine maintained patients, and outpatients with a mixture of substance use disorders. In the R21 phase (Year 1 of this R21/R33) reSET will be tailored and piloted for feasibility and acceptability within the Hub and Spoke system, using principles of Community-Based Participatory Research and an uncontrolled pilot trial in 15 OUD patients. All groundwork for the R33 controlled trial (protocol, standard operating procedures, CRFs, data and quality assurance systems, and regulatory approvals) will be completed. In the R33 phase we will conduct a patient-level, 6 month randomized controlled effectiveness trial, in which 200 patients with OUD initiating MAT with buprenorphine within the Penn State Hub and Spoke will be consented and randomly assigned to either treatment as usual (TAU) within the Hub and Spoke, or TAU plus the cognitive-behavioral intervention reSET (TAU+reSET). The primary outcome measure will be retention on buprenorphine treatment for 6 months, and secondary outcomes will include urine-confirmed abstinence, and improvements in coping skills, social functioning, mood, and HIV risk that are targeted by reSET. If found effective in supporting MAT, reSET, as a mobile app, has the potential to be rapidly disseminated across the U.S. health system in support of the STR initiative.